Biometric Flows topic

Biometric Flows

The package supports three main biometric integration styles.

PT-BR

O pacote suporta três estilos principais de integração biométrica.

Language guide

English is the primary language of this page.

PT-BR: os blocos marcados com este rótulo resumem as decisões principais em português do Brasil.

1. Flutter Widgets

Use FlutterSmartfaceMobilePlatform when the Flutter screen owns the surrounding layout and embeds the native SmartFace capture surface.

Main widget APIs:

2. Native Hosted Flows

Use SmartfaceHostedFlow when you want a native-managed UX with a smaller Flutter integration surface.

Main hosted APIs:

3. Enrollment Without Immediate Server Push

Use FlutterSmartfaceEnrollerPlatform when the flow needs to return descriptors or complete enrollment outside the default server push path.

Selection Guide

Need Recommended API
Fastest integration with native UI SmartfaceHostedFlow
Flutter-controlled layout and overlays FlutterSmartfaceMobilePlatform widget APIs
Descriptor-first or deferred backend submission FlutterSmartfaceEnrollerPlatform or enrollWithoutServerPushingWidget

Security Level Scale Note

  • Android native SmartfaceMobile uses the public securityLevel scale from 0 to 100.
  • Flutter widget and activity APIs follow the same 0 to 100 scale.
  • Current hosted-flow options are documented with a normalized 0.0 to 1.0 securityLevel.
  • Do not reuse the same numeric value between hosted flow and widget/activity APIs without converting it.

PT-BR

Escala atual: Android nativo e APIs Flutter de widget/activity usam 0 a 100; hosted flow está documentado com 0.0 a 1.0, então a conversão precisa ser explícita.

Example: Hosted Identification

await SmartfaceHostedFlow.identify(
	onComplete: ({
		required bool identified,
		required String customId,
		required double confidence,
		required double distance,
		String? imagePath,
	}) {
		// Handle identification result.
	},
	options: const IdentificationFlowOptions(
		livenessEnabled: true,
		enableCheckImageQuality: true,
		showUserInformation: true,
	),
);

Example: Flutter-Owned Identification Widget

final mobile = FlutterSmartfaceMobilePlatform.instance;

Widget buildIdentifyView(BuildContext context) {
	return mobile.identifyWidget(
		onIdentify: (result) {
			// Handle callback payload from the native layer.
		},
		customPermissionBuilder: (requestPermission) {
			return const SizedBox.shrink();
		},
		onLoadingWidget: const Center(child: CircularProgressIndicator()),
		faceMaskOverlay: const SizedBox.shrink(),
		builder: (cameraView, controller) {
			return Stack(children: [cameraView]);
		},
		livenessEnabled: true,
		enableCheckImageQuality: true,
	);
}

PT-BR

Use hosted flow quando quiser menos composição manual no Flutter e widgets quando a experiência visual da tela precisar ser controlada pelo app Flutter.

Libraries

flutter_smartface_enroller Overview Biometric Flows
Enrollment APIs focused on flows without immediate server push.
flutter_smartface_hosted_flow Overview Biometric Flows
Native hosted flows for identification and enrollment.
flutter_smartface_mobile Overview Integration License and Setup Biometric Flows UI and Camera
Main SmartFace Flutter API for biometric operations.